#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N = 13;
#define INF 0x7fffffff
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int d[N] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
auto lp_year = [](int& year)->void {if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) d[2] = 29; else d[2] = 28; };
void solve()
{
	int ans = 0, week = 6;
	for (int i = 2000; i <= 2020; i++)
	{
		lp_year(i);
		for (int m = 1; m <= 12; m++)
		{
			for (int day = 1; day <= d[m]; day++, week++)
			{
				ans++;
				if (week == 8) week = 1;
				if (week == 1 || day == 1) ans++;

				if (i == 2020 && m == 10 && day == 1)
				{
					pd(ans); puts(""); return;
				}
			}
		}
	}

}

int main()
{
	int T = 1;
	//sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}